import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect: '/c-oj/home',
    },
    {
      path: "/c-oj/home",
      name: "home",
      component: () => import("@/views/Home.vue"),
      children: [
        {
          path: "//c-oj/home/",
          redirect: '/c-oj/home/question',
        },
        {
          path: "user/exam",
          name: "userExam",
          component: () => import("@/views/UserExam.vue"),
          meta: {showBanner: false}
        },
        {
          path: "user/userDetail",
          name: "userDetail",
          component: () => import("@/views/UserDetail.vue"),
          meta: {showBanner: false}
        },
        {
          path: "exam",
          name: "exam",
          component: () => import("@/views/Exam.vue"),
          meta: {showBanner: true}
        },
        {
          path: "question",
          name: "question",
          component: () => import("@/views/Question.vue"),
          meta: {showBanner: true}
        }
      ]
    },
    {
      path: "/c-oj/login",
      name: "login",
      component: () => import("@/views/Login.vue"),
    }
  ]
})

export default router